package com.yima.baseproj.module.sys.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yima.baseproj.module.sys.user.model.SysUserAddParamModel;
import com.yima.baseproj.module.config.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.sql.Timestamp;

@Data
@TableName("sys_user")
public class SysUserEntity extends BaseEntity {

  @ApiModelProperty(value = "昵称")
  @TableField(value = "nick_name")
  private String nickName;

  @ApiModelProperty(value = "盐")
  private String salt;

  @ApiModelProperty(value = "登陆名")
  @TableField(value = "login_name")
  private String loginName;

  @ApiModelProperty(value = "密码")
  private String password;

  @ApiModelProperty(value = "状态")
  private String state;

  @ApiModelProperty(value = "登陆时间")
  @TableField(value = "login_time")
  private Timestamp loginTime;

  @ApiModelProperty(value = "登陆ip")
  @TableField(value = "login_ip")
  private String loginIp;

  @ApiModelProperty(value = "头像")
  @TableField(value = "head_url")
  private String headUrl;

  @ApiModelProperty(value = "手机号")
  private String phone;

  @ApiModelProperty(value = "邮件")
  private String email;

  public void setSysUserEntity(SysUserAddParamModel paramModel) {
    this.nickName = paramModel.getNickName();
    this.loginName = paramModel.getLoginName();
    this.phone = paramModel.getPhone();
    this.email = paramModel.getEmail();
    this.headUrl = paramModel.getHeadUrl();
  }
}